package net.zoneland.knowledge.dao;

import java.util.List;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

import net.zoneland.knowledge.controller.bean.UomUserOrgQueryVo;
import net.zoneland.knowledge.model.PartyUser;
import org.springframework.stereotype.Repository;
import net.zoneland.knowledge.model.PartyUserVoForSelect;

/**
 * 党员数据接口.
 * @author zmq
 * Date 2022/8/26 15:24
 */
@Mapper
public interface PartyUserMapper {

    /**
     * 根据员工编号获取党组织编号.
     * @param userId 员工oa账号
     * @return 党支部组织id
     */
    @Select({"select org_uuid from AITK_PARTY_USER where oa_id = #{userId,jdbcType = VARCHAR}"})
    String getOrgUUIDByUserId(String userId);

    /**
     * 查询党员.
     * @param condition 查询条件
     * @return 党员集合
     */
    @Select({
        "<script>",
        "select a.DISPLAY_NAME, a.YG_ID, a.MOBILE, a.PARTY_DATE, a.TO_FULL_MEMBERS_DATE, a.JOIN_DJ_WORK_TIME, ",
        "a.DJ_WORK_TIME, a.ADMINISTRATIVE_DUTIES, a.PROFESSIONAL_TITLE_LEVEL, a.IS_SENIOR, a.IS_SUSPEND_JOB, ",
        "a.IS_GRIDSUPERVISOR, a.POSITION, a.LAST_UPGRADE_TIME, a.IS_TWO_WAY_COMMUNICATION, ",
        "a.WHEN_WHERE_WHO_PARTY, a.ORG_UUID, b.ORG_NAME, b.DWSJ, a.OA_ID, a.IMPORT_TIME,",
        "a.PART_TIME, a.PARTY_WORKER, a.EMAIL, a.COMPANY_DN, a.GANSHI, a.PIONEER_POST, a.PIONEER_POST_PIID,",
        "a.dept_dn, b.ORG_SHORT_NAME, b.ORG_SJ, b.ORG_DW, b.SHORT_NAME2 ,a.PARTY_DUTY, a.position_for_display, ",
        "c.ENABLED FAVORITE_STATUS",
        "FROM AITK_PARTY_USER a left join AITK_PARTY_ORG b on a.ORG_UUID  =  b.ORG_UUID ",
        "left join AITK_FAVORITE c on a.YG_ID = c.ES_QUESTION_ID and c.CREATOR_UID = #{userPojo.userID,jdbcType=VARCHAR} ",
        "WHERE 1 = 1 ",
        "<if test=\"userName != null and userName != ''\"> AND " ,
        "(a.DISPLAY_NAME like #{userName,jdbcType = VARCHAR} " ,
        "or a.YG_ID=#{queryTextForYgId,jdbcType=VARCHAR} " ,
        "or a.mobile=#{queryTextForMobile,jdbcType=VARCHAR} ) </if> ",
        "<if test=\"ygId != null and ygId != ''\"> AND YG_ID=#{ygId,jdbcType=VARCHAR} </if> ",
        "<if test=\"oaId != null and oaId != ''\"> AND OA_ID=#{oaId,jdbcType=VARCHAR} </if> ",
        "<if test=\"orgUuid != null and orgUuid != ''\"> AND ORG_UUID=#{orgUuid,jdbcType=VARCHAR} </if> ",
        "<if test=\"mobile != null and mobile != ''\"> AND MOBILE=#{mobile,jdbcType=VARCHAR} </if> ",
        "</script>"
    })
    @Results(id = "userResultMap", value = {
        @Result(column = "DISPLAY_NAME", property = "displayName", jdbcType =  JdbcType.VARCHAR, id = true),
        @Result(column = "YG_ID", property = "ygId", jdbcType = JdbcType.VARCHAR),
        @Result(column = "MOBILE", property = "mobile", jdbcType = JdbcType.VARCHAR),
        @Result(column = "PARTY_DATE", property = "partyDate", jdbcType = JdbcType.VARCHAR),
        @Result(column = "TO_FULL_MEMBERS_DATE", property = "toFullMembersDate", jdbcType = JdbcType.VARCHAR),
        @Result(column = "JOIN_DJ_WORK_TIME", property = "joinDjWorkTime", jdbcType = JdbcType.VARCHAR),
        @Result(column = "DJ_WORK_TIME", property = "djWorkTime", jdbcType = JdbcType.VARCHAR),
        @Result(column = "ADMINISTRATIVE_DUTIES", property = "administrativeDuties", jdbcType = JdbcType.VARCHAR),
        @Result(column = "PROFESSIONAL_TITLE_LEVEL", property = "professionalTitleLevel", jdbcType = JdbcType.VARCHAR),
        @Result(column = "IS_SENIOR", property = "isSenior", jdbcType = JdbcType.VARCHAR),
        @Result(column = "IS_SUSPEND_JOB", property = "isSuspendJob", jdbcType = JdbcType.VARCHAR),
        @Result(column = "IS_GRIDSUPERVISOR", property = "isGridSupervisor", jdbcType = JdbcType.VARCHAR),
        @Result(column = "POSITION", property = "position", jdbcType = JdbcType.VARCHAR),
        @Result(column = "LAST_UPGRADE_TIME", property = "lastUpgradeTime", jdbcType = JdbcType.VARCHAR),
        @Result(column = "IS_TWO_WAY_COMMUNICATION", property = "isTwoWayCommunication", jdbcType = JdbcType.VARCHAR),
        @Result(column = "WHEN_WHERE_WHO_PARTY", property = "whenWhereWhoParty", jdbcType = JdbcType.VARCHAR),
        @Result(column = "ORG_UUID", property = "orgUUID", jdbcType = JdbcType.VARCHAR),
        @Result(column = "ORG_NAME", property = "orgName", jdbcType = JdbcType.VARCHAR),
        @Result(column = "DWSJ", property = "dwsj", jdbcType = JdbcType.VARCHAR),
        @Result(column = "OA_ID", property = "oaId", jdbcType = JdbcType.VARCHAR),
        @Result(column = "IMPORT_TIME", property = "importTime", jdbcType = JdbcType.TIMESTAMP),
        @Result(column = "PART_TIME", property = "partTime", jdbcType = JdbcType.DECIMAL),
        @Result(column = "PARTY_WORKER", property = "partyWorker", jdbcType = JdbcType.DECIMAL),
        @Result(column = "EMAIL", property = "email", jdbcType = JdbcType.VARCHAR),
        @Result(column = "COMPANY_DN", property = "companyDn", jdbcType = JdbcType.VARCHAR),
        @Result(column = "ganshi", property = "ganShi", jdbcType = JdbcType.VARCHAR),
        @Result(column = "PIONEER_POST", property = "pioneerPost", jdbcType = JdbcType.VARCHAR),
        @Result(column = "PIONEER_POST_PIID", property = "pioneerPostPiid", jdbcType = JdbcType.VARCHAR),
        @Result(column = "DEPT_DN", property = "deptDn", jdbcType = JdbcType.VARCHAR),
        @Result(column = "ORG_SHORT_NAME", property = "orgShortName", jdbcType = JdbcType.VARCHAR),
        @Result(column = "ORG_SJ", property = "orgSj", jdbcType = JdbcType.VARCHAR),
        @Result(column = "ORG_DW", property = "orgDw", jdbcType = JdbcType.VARCHAR),
        @Result(column = "ORG_SHOT_NAME2", property = "shortName2", jdbcType = JdbcType.VARCHAR),
        @Result(column = "party_duty", property = "partyDuty", jdbcType = JdbcType.VARCHAR),
        @Result(column = "position_for_display", property = "positionForDisplay", jdbcType = JdbcType.VARCHAR),
        @Result(column = "FAVORITE_STATUS", property = "favoriteStatus", jdbcType = JdbcType.BOOLEAN),
        @Result(column = "COMPANY_NAME", property = "companyName", jdbcType = JdbcType.VARCHAR),
    })
    List<PartyUser> search(final UomUserOrgQueryVo condition);

    /**
     * 查询党员.
     * @param userId oa_uid
     * @return 党员信息
     */
    @Select({
            "select a.DISPLAY_NAME, a.YG_ID, a.MOBILE, a.PARTY_DATE, a.TO_FULL_MEMBERS_DATE, a.JOIN_DJ_WORK_TIME, ",
            "a.DJ_WORK_TIME, a.ADMINISTRATIVE_DUTIES, a.PROFESSIONAL_TITLE_LEVEL, a.IS_SENIOR, a.IS_SUSPEND_JOB, ",
            "a.IS_GRIDSUPERVISOR, a.POSITION, a.LAST_UPGRADE_TIME, a.IS_TWO_WAY_COMMUNICATION, ",
            "a.WHEN_WHERE_WHO_PARTY, a.ORG_UUID, b.ORG_NAME, b.DWSJ, a.OA_ID, a.IMPORT_TIME ",
            " ,a.PART_TIME, a.PARTY_WORKER, a.EMAIL, a.COMPANY_DN, a.GANSHI, a.PIONEER_POST,a.PIONEER_POST_PIID,",
            "a.dept_dn, b.ORG_SHORT_NAME, b.ORG_SJ, b.ORG_DW, b.SHORT_NAME2 ,a.PARTY_DUTY, a.position_for_display ",
            "FROM AITK_PARTY_USER a left join AITK_PARTY_ORG b on a.ORG_UUID  =  b.ORG_UUID ",
            "WHERE a.OA_ID  =  #{userId,jdbcType = VARCHAR} "
    })
    @ResultMap(value = {"userResultMap"})
    PartyUser queryByUserId(String userId);

    /**
     * 查询党员.
     * @param beginTime 时间
     * @return 党员集合
     */
    @Select({
            "select a.DISPLAY_NAME, a.YG_ID, a.MOBILE, a.PARTY_DATE, a.TO_FULL_MEMBERS_DATE, a.JOIN_DJ_WORK_TIME, ",
            "a.DJ_WORK_TIME, a.ADMINISTRATIVE_DUTIES, a.PROFESSIONAL_TITLE_LEVEL, a.IS_SENIOR, a.IS_SUSPEND_JOB, ",
            "a.IS_GRIDSUPERVISOR, a.POSITION, a.LAST_UPGRADE_TIME, a.IS_TWO_WAY_COMMUNICATION, ",
            "a.WHEN_WHERE_WHO_PARTY, a.ORG_UUID, b.ORG_NAME, b.DWSJ, a.OA_ID, a.IMPORT_TIME ",
            " ,a.PART_TIME, a.PARTY_WORKER, a.EMAIL, a.COMPANY_DN, a.GANSHI, a.PIONEER_POST, a.PIONEER_POST_PIID, ",
            "a.dept_dn, b.ORG_SHORT_NAME, b.ORG_SJ, b.ORG_DW, b.SHORT_NAME2 ,a.PARTY_DUTY, a.position_for_display ",
            "FROM AITK_PARTY_USER a left join AITK_PARTY_ORG b on a.ORG_UUID  =  b.ORG_UUID ",
            "WHERE a.IMPORT_TIME> = to_date(#{beginTime},'yyyy-mm-dd HH:mi:ss')"
    })
    @ResultMap(value = {"userResultMap"})
    List<PartyUser> getUserByTime(String beginTime);

    /**
     * 查询先锋岗用户.
     * @param orgUUID 党组织id
     * @return 党员列表
     */
    @Select({
        "select a.DISPLAY_NAME, a.YG_ID, a.MOBILE, a.OA_ID, a.PIONEER_POST_PIID ",
        "FROM AITK_PARTY_USER a ",
        "WHERE a.PIONEER_POST = 1 ",
        "and a.ORG_UUID = #{orgUUID,jdbcType = VARCHAR}"
    })
    @Results({
        @Result(column = "DISPLAY_NAME", property = "displayName", jdbcType =  JdbcType.VARCHAR, id = true),
        @Result(column = "YG_ID", property = "ygId", jdbcType = JdbcType.VARCHAR),
        @Result(column = "MOBILE", property = "mobile", jdbcType = JdbcType.VARCHAR),
        @Result(column = "OA_ID", property = "oaId", jdbcType = JdbcType.VARCHAR),
        @Result(column = "PIONEER_POST_PIID", property = "pioneerPostPiid", jdbcType = JdbcType.VARCHAR)
    })
    List<PartyUser> orgPioneerPostUsers(@Param("orgUUID") final String orgUUID);

    /**
     * 查询党员手机号.
     * @param condition 查询条件
     * @return 党员手机号列表
     */
    @Select({
            "<script>",
            "SELECT a.MOBILE ",
            "FROM AITK_PARTY_USER a left join AITK_PARTY_ORG b on a.ORG_UUID  =  b.ORG_UUID ",
            "WHERE  1 = 1 ",
            "<if test=\"orgUuid != null and orgUuid != ''\"> AND a.ORG_UUID = #{orgUuid, jdbcType = VARCHAR} </if> ",
            "<if test=\"queryText != null and queryText != ''\"> AND " ,
            "(a.DISPLAY_NAME like #{queryText, jdbcType = VARCHAR} " ,
            "or a.YG_ID = #{queryTextForYgId, jdbcType = VARCHAR} " ,
            "or a.mobile = #{queryTextForMobile, jdbcType = VARCHAR} ) </if> ",
            "</script>"
    })
    List<String> searchUserMobilesByCondition(final UomUserOrgQueryVo condition);

    /**
     * 查询党员.
     * @param condition 查询条件
     * @return 党员列表
     */
    @Select({
        "<script>",
        "select a.DISPLAY_NAME, a.OA_ID, b.ORG_SHORT_NAME ",
        "FROM AITK_PARTY_USER a left join AITK_PARTY_ORG b on a.ORG_UUID  =  b.ORG_UUID ",
        "WHERE  1 = 1 ",
        "<if test=\"orgUuid != null and orgUuid != ''\"> AND a.ORG_UUID=#{orgUuid,jdbcType=VARCHAR} </if> ",
        "<if test=\"queryText != null and queryText != ''\"> AND " ,
        "(a.DISPLAY_NAME like #{queryText,jdbcType = VARCHAR} " ,
        "or a.YG_ID=#{queryTextForYgId,jdbcType=VARCHAR} " ,
        "or a.mobile=#{queryTextForMobile,jdbcType=VARCHAR} ) </if> ",
        "</script>"
    })
    @Results({
        @Result(column = "DISPLAY_NAME", property = "displayName", jdbcType =  JdbcType.VARCHAR, id = true),
        @Result(column = "YG_ID", property = "ygId", jdbcType = JdbcType.VARCHAR),
        @Result(column = "MOBILE", property = "mobile", jdbcType = JdbcType.VARCHAR),
        @Result(column = "OA_ID", property = "oaId", jdbcType = JdbcType.VARCHAR),
        @Result(column = "ORG_SHORT_NAME", property = "orgShortName", jdbcType = JdbcType.VARCHAR)
    })
    List<PartyUserVoForSelect> searchUserByConditionForTree(UomUserOrgQueryVo condition);

    @Select({
            "select a.DISPLAY_NAME, a.YG_ID, a.OA_ID, a.ORG_UUID,a.MOBILE, b.ORG_SHORT_NAME ",
            "FROM AITK_PARTY_USER a left join AITK_PARTY_ORG b on a.ORG_UUID  =  b.ORG_UUID ",
            "WHERE a.ganshi = 1 ",
            "and a.ORG_UUID = #{orgUUID,jdbcType = VARCHAR}"
    })
    @Results({
            @Result(column = "DISPLAY_NAME", property = "displayName", jdbcType =  JdbcType.VARCHAR, id = true),
            @Result(column = "YG_ID", property = "ygId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "OA_ID", property = "oaId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "MOBILE", property = "mobile", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ORG_SHORT_NAME", property = "orgShortName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ORG_UUID", property = "orgUUID", jdbcType = JdbcType.VARCHAR)
    })
    List<PartyUser> getGanshiByOrgUuid(@Param("orgUUID") String orgUUID);

    /**
     * 查询党员信息.
     * @param ygIds ygIds
     * @return 党员集合
     */
    @Select({
            "<script>",
            "select a.DISPLAY_NAME, a.YG_ID, a.MOBILE, a.PARTY_DATE, a.TO_FULL_MEMBERS_DATE, a.JOIN_DJ_WORK_TIME, ",
            "a.DJ_WORK_TIME, a.ADMINISTRATIVE_DUTIES, a.PROFESSIONAL_TITLE_LEVEL, a.IS_SENIOR, a.IS_SUSPEND_JOB, ",
            "a.IS_GRIDSUPERVISOR, a.POSITION, a.LAST_UPGRADE_TIME, a.IS_TWO_WAY_COMMUNICATION, ",
            "a.WHEN_WHERE_WHO_PARTY, a.ORG_UUID, b.ORG_NAME, b.DWSJ, a.OA_ID, a.IMPORT_TIME ",
            " ,a.PART_TIME, a.PARTY_WORKER, a.EMAIL, a.COMPANY_DN, a.GANSHI, a.PIONEER_POST, a.PIONEER_POST_PIID, ",
            "a.dept_dn, b.ORG_SHORT_NAME, b.ORG_SJ, b.ORG_DW, b.SHORT_NAME2 ,a.PARTY_DUTY, a.position_for_display ",
            "FROM AITK_PARTY_USER a left join AITK_PARTY_ORG b on a.ORG_UUID  =  b.ORG_UUID ",
            "WHERE a.YG_ID in ",
            "<foreach collection='ygIds' index='index' item='item' open='(' separator=',' close=')'>",
            "#{item}</foreach> ",
            "</script>"
    })
    @ResultMap(value = {"userResultMap"})
    List<PartyUser> getUserByYgIds(@Param("ygIds") List<String> ygIds);

    /**
     * 按照指定的公司排序，查询部门为党委办公室、YG_ID和OA_ID不为空的市公司党办人员信息
     * @return 市公司党办人员信息列表
     */
    @Select({
            "select a.DISPLAY_NAME, a.YG_ID, a.MOBILE, a.PARTY_DATE, a.TO_FULL_MEMBERS_DATE, a.JOIN_DJ_WORK_TIME, ",
            "a.DJ_WORK_TIME, a.ADMINISTRATIVE_DUTIES, a.PROFESSIONAL_TITLE_LEVEL, a.IS_SENIOR, a.IS_SUSPEND_JOB, ",
            "a.IS_GRIDSUPERVISOR, a.POSITION, a.LAST_UPGRADE_TIME, a.IS_TWO_WAY_COMMUNICATION, ",
            "a.WHEN_WHERE_WHO_PARTY, a.ORG_UUID, b.ORG_NAME, b.DWSJ, a.OA_ID, a.IMPORT_TIME ",
            " ,a.PART_TIME, a.PARTY_WORKER, a.EMAIL, a.COMPANY_DN, a.GANSHI, a.PIONEER_POST,a.PIONEER_POST_PIID,",
            "a.dept_dn, b.ORG_SHORT_NAME, b.ORG_SJ, b.ORG_DW, b.SHORT_NAME2 ,a.PARTY_DUTY, a.position_for_display, ",
            "b.COMPANY_NAME",
            "from aitk_party_user a, AITK_PARTY_ORG b where a.ORG_UUID = b.ORG_UUID and a.DEPT_DN LIKE '%党委办公室%' ",
            "and a.YG_ID is not NULL and a.OA_ID is not NULL ORDER BY DECODE(b.COMPANY_NAME, '省公司', 1, '杭州分公司', 2, '宁波分公司', 3, '温州分公司', ",
            "4, '台州分公司', 5, '金华分公司', 6, '绍兴分公司', 7, '嘉兴分公司', 8, '湖州分公司', 9, '丽水分公司', 10, '舟山分公司', ",
            "11, '衢州分公司', 12) ",
    })
    @ResultMap(value = {"userResultMap"})
    List<PartyUser> getCityPartyUser();

    /**
     * 根据公司名查询所有支部下人员信息
     * @param companyName 公司名
     * @return 支部下人员信息
     */
    @Select({
            "select a.DISPLAY_NAME, a.YG_ID, a.OA_ID, a.ORG_UUID,a.MOBILE, b.ORG_SHORT_NAME ",
            "FROM AITK_PARTY_USER a left join AITK_PARTY_ORG b on a.ORG_UUID  =  b.ORG_UUID ",
            "WHERE a.ganshi = 1 and a.OA_ID is not NULL ",
            "and b.COMPANY_NAME = #{companyName,jdbcType = VARCHAR}"
    })
    @Results({
            @Result(column = "DISPLAY_NAME", property = "displayName", jdbcType =  JdbcType.VARCHAR, id = true),
            @Result(column = "YG_ID", property = "ygId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "OA_ID", property = "oaId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "MOBILE", property = "mobile", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ORG_SHORT_NAME", property = "orgShortName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ORG_UUID", property = "orgUUID", jdbcType = JdbcType.VARCHAR)
    })
    List<PartyUser> getGanshiByCompany(@Param("companyName") String companyName);

    /**
     * 查询党员.
     * @param userIds oa_uids
     * @return 党员信息
     */
    @Select({
            "<script>",
            "select a.DISPLAY_NAME, a.YG_ID, a.MOBILE, a.PARTY_DATE, a.TO_FULL_MEMBERS_DATE, a.JOIN_DJ_WORK_TIME, ",
            "a.DJ_WORK_TIME, a.ADMINISTRATIVE_DUTIES, a.PROFESSIONAL_TITLE_LEVEL, a.IS_SENIOR, a.IS_SUSPEND_JOB, ",
            "a.IS_GRIDSUPERVISOR, a.POSITION, a.LAST_UPGRADE_TIME, a.IS_TWO_WAY_COMMUNICATION, ",
            "a.WHEN_WHERE_WHO_PARTY, a.ORG_UUID, b.ORG_NAME, b.DWSJ, a.OA_ID, a.IMPORT_TIME ",
            " ,a.PART_TIME, a.PARTY_WORKER, a.EMAIL, a.COMPANY_DN, a.GANSHI, a.PIONEER_POST,a.PIONEER_POST_PIID,",
            "a.dept_dn, b.ORG_SHORT_NAME, b.ORG_SJ, b.ORG_DW, b.SHORT_NAME2 ,a.PARTY_DUTY, a.position_for_display ",
            "FROM AITK_PARTY_USER a left join AITK_PARTY_ORG b on a.ORG_UUID  =  b.ORG_UUID ",
            "WHERE a.OA_ID in ",
            "<foreach collection='userIds' index='index' item='item' open='(' separator=',' close=')'>",
            "#{item}</foreach> ",
            "</script>"
    })
    @ResultMap(value = {"userResultMap"})
    List<PartyUser> queryByUserIds(@Param("userIds") List<String> userIds);

    /**
     * 根据员工编号查询党员信息
     * @param empNo
     * @return
     */
    @Select({"SELECT YG_ID, DISPLAY_NAME, MOBILE, OA_ID, COMPANY_DN FROM AITK_PARTY_USER WHERE YG_ID = #{ygId, jdbcType = VARCHAR}"})
    @Results({
            @Result(column = "DISPLAY_NAME", property = "displayName", jdbcType =  JdbcType.VARCHAR, id = true),
            @Result(column = "YG_ID", property = "ygId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "OA_ID", property = "oaId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "MOBILE", property = "mobile", jdbcType = JdbcType.VARCHAR),
            @Result(column = "COMPANY_DN", property = "companyDn", jdbcType = JdbcType.VARCHAR)
    })
    PartyUser findPartyUserByEmpNo(final @Param("ygId") String empNo);

    /**
     * 根据手机号查询党员信息
     * @param mobile
     * @return
     */
    @Select({"SELECT YG_ID, DISPLAY_NAME, MOBILE, OA_ID, COMPANY_DN FROM AITK_PARTY_USER WHERE MOBILE = #{mobile, jdbcType = VARCHAR}"})
    @Results({
            @Result(column = "DISPLAY_NAME", property = "displayName", jdbcType =  JdbcType.VARCHAR, id = true),
            @Result(column = "YG_ID", property = "ygId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "OA_ID", property = "oaId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "MOBILE", property = "mobile", jdbcType = JdbcType.VARCHAR),
            @Result(column = "COMPANY_DN", property = "companyDn", jdbcType = JdbcType.VARCHAR)
    })
    PartyUser findPartyUserByMobile(final @Param("mobile") String mobile);
}
